#include "LaundryMachine.h"


LaundryMachine::LaundryMachine()
{
  ProgramSelector * selector = new ProgramSelector();
  SelectProgram(selector->Start());
  RunProgram();
}

void LaundryMachine::SelectProgram(int p)
{

  Serial.println("Selecting program...");

  switch(p)
  {
  case 1:
    this->currentProgram = new ProgramA();
    Serial.println("Selected program A");
    break;
  case 2:
    this->currentProgram = new ProgramB();
    Serial.println("Selected program B");
    break;
  case 3: 
    this->currentProgram = new ProgramC();
    Serial.println("Selected program C");
    break;
  }
}

void LaundryMachine::RunProgram()
{
  currentProgram->execute();
  Serial.println("Running program...");
}

void LaundryMachine::StopProgram()
{
  Serial.println("Stopping program...");
  currentProgram->stop();
}



